package redis;

import jedis.demo.JedisApI;
import jedis.util.JedisUtil;
import org.junit.Test;

public class JedisTest2 {
    private JedisApI jedisApI;

    @Test
    public void test() throws Exception {
        jedisApI= JedisUtil.starUp();

//        System.out.println("添加键值是否成功"+jedisApI.set("name",50, "张三"));

        System.out.println("查看数据"+jedisApI.get("name"));

        System.out.println("是否存在"+jedisApI.exist("name"));

        System.out.println("剩余时间"+jedisApI.ttl("name"));

//        jedisApI.delete("name");
        JedisUtil.tearDown(jedisApI);
    }
}
